****
****
****	GSS_script.do
****
****
****	Replication file for anlyses of GSS for:
****		
****	"Intersectionality, Depression, and Voter Turnout"
****
****	by Christopher Ojeda and Christine Slaughter
****
****
****	Table of Contents
****
****	- Section 1: Data prep
****
****	- Section 2: Analyses
****


********************************************************************************
****** Section 1: Data Prep

**
** Vote
gen vote = .
replace vote = vote08 if year == 2010 | year == 2012
replace vote = vote04 if year == 2006 | year == 2008
replace vote = vote00 if year == 2002 | year == 2004
replace vote = vote96 if year == 1998 | year == 2000
replace vote = vote92 if year == 1994 | year == 1996
replace vote = vote88 if year == 1990 | year == 1992
replace vote = vote84 if year == 1986 | year == 1988
replace vote = vote80 if year == 1982 | year == 1984
replace vote = vote76 if year == 1978 | year == 1980
replace vote = vote72 if year == 1974 | year == 1976
replace vote = vote68 if year == 1970 | year == 1972
recode vote 2=0 3=. 4=.
replace vote = . if vote == . | vote == .d | vote == .n

**
** Depression

*1996
sum shakeblu calm outraged hapfeel sad ashamed excited lonely fearful ovrjoyed worried contentd anxious restless madat atease angry embarrss proud
local a = 1
foreach var of varlist shakeblu calm outraged hapfeel sad ashamed excited lonely fearful ovrjoyed worried contentd anxious restless madat atease angry embarrss proud{
gen m96health`a' = `var'
replace m96health`a' = . if `var' == .i | `var' == .d | `var' == .n
local a = `a' + 1
}
*
local val 2 4 7 10 12 16 19
foreach a of local val {
recode m96health`a' 7=0 6=1 5=2 4=3 3=4 2=5 6=1 0=7
}
*
egen mhealth1996 = rowmean(m96health1 m96health4 m96health5 m96health7 m96health8 m96health10 m96health11 m96health12 m96health19)


*1998
sum nocheer nervous fidgety hopeless effort wrthless
local a = 1
foreach var of varlist nocheer nervous fidgety hopeless effort wrthless{
gen m98health`a' = `var'
replace m98health`a' = . if `var' == .i | `var' == .d | `var' == .n
recode m98health`a' 5=0 4=1 3=2 2=3 1=4
local a = `a' + 1
}
*
egen mhealth1998 = rowmean(m98health1 m98health4 m98health5 m98health6)

*Combining years
xtile mhealth1996_tile = mhealth1996, nq(5)
xtile mhealth1998_tile = mhealth1998, nq(5)
gen mhealth_tile = .
replace mhealth_tile = mhealth1996_tile if year == 1996
replace mhealth_tile = mhealth1998_tile if year == 1998

**
** Gender
tab sex
gen female = 0
replace female = 1 if sex == 2
replace female = . if sex == .

**
** Race
tab race, missing
gen white = 0
gen black = 0
gen otherrace = 0
replace white = 1 if race == 1
replace black = 1 if race == 2
replace otherrace = 1 if race == 3

**
** Age
tab age, missing
replace age = . if age == .n

**
** Education
sum educ
tab1 educ, missing
replace educ = . if educ == .n | educ == .d | educ == .c

**
** Income
sum income91 income98
foreach var of varlist income91 income98{
replace `var' = . if `var' == .a | `var' == .i
}
*

xtile income91_tile = income91, nq(5)
xtile income98_tile = income98, nq(5)

gen inc_tile = .
replace inc_tile = income91_tile if year == 1996
replace inc_tile = income98_tile if year == 1998

**
** Church attendance
replace attend = . if attend == .d
gen attend_mo = attend
recode attend_mo 8=1 7=1 6=1 5=1 4=1 3=0 2=0 1=0

**
** Marital status
tab1 marital, missing
gen married = 0
replace married = 1 if marital == 1
replace married = . if marital == .n

**
** Patisan strength
tab partyid
replace partyid = . if partyid == .n
gen partyid_2 = partyid
replace partyid_2 = . if partyid == 7
gen party_strength = abs((partyid_2 - 3))

**
** Health
replace health = . if health == .i | health == .n | health == .d
recode health 4=0 3=1 2=2 1=3

**
** Group consciousness
gen close_overall = .
replace close_overall = closeblk if black == 1
replace close_overall = closewht if black == 0

**
** Intersectional groups
gen inter_cat = .
replace inter_cat = 1 if black == 0 & female == 0
replace inter_cat = 2 if black == 0 & female == 1
replace inter_cat = 3 if black == 1 & female == 0
replace inter_cat = 4 if black == 1 & female == 1


********************************************************************************
********** Section 2: Analyses 

/* THE RESULTS ARE NOT REPORTED IN TEXT, BUT ARE PRESENTED HERE AS IF THEY WERE
AS THEY CORRESPOND TO PSID/ADD HEALTH ANALYSES THAT ARE REPORTED IN TEXT. */

keep if year == 1996 | year == 1998
drop if race == 3
svyset [weight=wtssall]
gen year_dum = 0
replace year_dum = 1 if year == 1998


**
** Methods, Data and Measures

* Overall mean and SD [Table 2]
sum mhealth1996
sum mhealth1998

* Alpha scores for depression scales [Table 2]
alpha m96health1 m96health4 m96health5 m96health7 m96health8 m96health10 m96health11 m96health12 m96health19, std item
alpha m98health1 m98health4 m98health5 m98health6, std item

* Mean depression by group [Table 2]
forvalues i=1(1)4{
sum mhealth1996 if inter_cat == `i'
sum mhealth1998 if inter_cat == `i'
}
*

**
** The Depression-Participation Gap

* Multivariate regression of vote on depression [coefficients for Figure 2, Table A.7]
forvalues i=1(1)5{
matrix gss_gap`i' = J(1,2,.)
matrix coln gss_gap`i' = estimate se
}
*
svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum
quietly: lincom mhealth_tile
matrix gss_gap1[1,1] = r(estimate)
matrix gss_gap1[1,2] = r(se)

svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum if inter_cat == 1
quietly: lincom mhealth_tile
matrix gss_gap2[1,1] = r(estimate)
matrix gss_gap2[1,2] = r(se)

svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum if inter_cat == 2
quietly: lincom mhealth_tile
matrix gss_gap3[1,1] = r(estimate)
matrix gss_gap3[1,2] = r(se)

svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum if inter_cat == 3
quietly: lincom mhealth_tile
matrix gss_gap4[1,1] = r(estimate)
matrix gss_gap4[1,2] = r(se)

svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum if inter_cat == 4
quietly: lincom mhealth_tile
matrix gss_gap5[1,1] = r(estimate)
matrix gss_gap5[1,2] = r(se)

matrix rowname gss_gap1 = "Overall" 
matrix rowname gss_gap2 = "White Men" 
matrix rowname gss_gap3 = "White Women" 
matrix rowname gss_gap4 = "Black Men" 
matrix rowname gss_gap5 = "Black Women"

* Interaction term [Note in text about Figure 2]
svy: logit vote c.mhealth_tile##inter_cat age educ inc_tile attend married party_strength health year_dum

* Relative effect of depression [Table 3]
svy: logit vote mhealth_tile female black age educ inc_tile attend married party_strength health year_dum
sum mhealth_tile educ attend party_strength age inc_tile
margins, at(mhealth_tile = (1.433254 4.277972))
margins, at(educ = (10.38717 16.22851))
margins, at(attend = (0.975338 6.393922))
margins, at(party_strength = (0.702506 2.709304))
margins, at(age = (28.7015 62.79692))
margins, at(inc_tile = (1.46721 4.286042))

**
** Mitigating the Gap
		
* Income interaction models [Table 4, Table A.10]
svy: logit vote c.mhealth_tile##c.inc_tile female black age educ inc_tile attend married party_strength health year_dum 
svy: logit vote c.mhealth_tile##c.inc_tile age educ inc_tile attend married party_strength health year_dum if inter_cat == 1
svy: logit vote c.mhealth_tile##c.inc_tile age educ inc_tile attend married party_strength health year_dum if inter_cat == 2
svy: logit vote c.mhealth_tile##c.inc_tile age educ inc_tile attend married party_strength health year_dum if inter_cat == 3
svy: logit vote c.mhealth_tile##c.inc_tile age educ inc_tile attend married party_strength health year_dum if inter_cat == 4

* Church attendance interaction models [Table 4, Table A.11]
svy: logit vote c.mhealth_tile##c.attend female black age educ inc_tile attend married party_strength health year_dum 
svy: logit vote c.mhealth_tile##c.attend age educ inc_tile attend married party_strength health year_dum if inter_cat == 1
svy: logit vote c.mhealth_tile##c.attend age educ inc_tile attend married party_strength health year_dum if inter_cat == 2
svy: logit vote c.mhealth_tile##c.attend age educ inc_tile attend married party_strength health year_dum if inter_cat == 3
svy: logit vote c.mhealth_tile##c.attend age educ inc_tile attend married party_strength health year_dum if inter_cat == 4

* Group consciousness interaction models [Table 4, Table A.12]
svy: logit vote c.mhealth_tile##c.close_overall female black age educ inc_tile attend married party_strength health year_dum 
svy: logit vote c.mhealth_tile##c.close_overall age educ inc_tile attend married party_strength health year_dum if inter_cat == 1
svy: logit vote c.mhealth_tile##c.close_overall age educ inc_tile attend married party_strength health year_dum if inter_cat == 2
svy: logit vote c.mhealth_tile##c.close_overall age educ inc_tile attend married party_strength health year_dum if inter_cat == 3
svy: logit vote c.mhealth_tile##c.close_overall age educ inc_tile attend married party_strength health year_dum if inter_cat == 4


**
** Appendix

* Descriptive statistics, overall [Table A.1]
sum vote mhealth_tile female black age educ inc_tile attend married party_strength health close_overall if mhealth_tile != .

* Correlations between variables [Table A.4]
pwcorr vote mhealth_tile female black age educ inc_tile attend married party_strength health close_overall if mhealth_tile != .

* Effect of depression on each mitigator [Table A.20]
svy: ologit inc_tile mhealth_tile female black age educ attend married party_strength health year_dum
svy: ologit attend mhealth_tile female black age educ inc_tile married party_strength health year_dum 
svy: ologit close_overall mhealth_tile female black age educ inc_tile attend married party_strength health year_dum 
